Skip to content

fix: status code propagation#172

Merged
x032205 merged 1 commit intomainfrom
fix-status-code
Apr 9, 2026
Merged

fix: status code propagation#172
x032205 merged 1 commit intomainfrom
fix-status-code

Conversation

@x032205
Copy link
Copy Markdown
Member

@x032205 x032205 commented Apr 7, 2026

Description 📣

Fix status code propagation

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 7, 2026

Greptile Summary

This PR fixes SSH exit-status propagation in the PAM proxy by splitting the single bidirectional error channel into two separate done channels (clientToServerDone / serverToClientDone), explicitly calling serverChannel.CloseWrite() when the client-to-server direction finishes (signalling EOF to the remote process so it delivers its exit-status), and raising the serverReqDone window from 500 ms to 3 s. The two remaining findings are both P2 style suggestions around goroutine lifecycle clarity and cumulative teardown latency.

Confidence Score: 5/5

Safe to merge; the fix is logically sound with no P0/P1 defects — only minor style and latency observations remain.

All findings are P2. No goroutine leaks, no data-loss paths, and no security issues introduced. The two style comments concern goroutine lifecycle explicitness and potential teardown latency, neither of which blocks correctness.

No files require special attention.

Important Files Changed

Filename Overview
packages/pam/handlers/ssh/proxy.go Refactors channel data-proxy teardown to use two separate done channels, adds explicit CloseWrite to flush stdin EOF so the remote process delivers exit-status, and raises the serverReqDone timeout from 500 ms to 3 s. The logic is mostly correct, but the clientToServerDone goroutine is intentionally not awaited when serverToClientDone fires first, and worst-case teardown latency doubles to 6 s.

Reviews (1): Last reviewed commit: "fix status code propagation" | Re-trigger Greptile

Comment thread packages/pam/handlers/ssh/proxy.go
Comment thread packages/pam/handlers/ssh/proxy.go
@x032205 x032205 merged commit c6a4cf0 into main Apr 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants